package Controler;
import java.util.ArrayList;

import Client.*;


public class Search_Result_Controler {


/**
 * method that asking for item from DB
 * @param itemName
 * @param authorName
 * @param subject
 * @param description
 * @return
 */
	public ArrayList<String> searchFotItems(String itemName, String authorName, String subject, String description)
	{
		
		return  BusinessImplements.GetInstance().getServerProxy().searchFortItems(itemName, authorName, subject, description);	
	}
	
	/**
	 * this method asking to order an item fro user
	 * @param userID
	 * @param itemName
	 * @return
	 */
	public boolean puttingOrder(String userID, String itemName)
	{
		
		return BusinessImplements.GetInstance().getServerProxy().putOrder(userID, itemName);

	}
	
	/**
	 * method that check if it possible to order
	 * @param ItemId
	 * @param userId
	 * @return
	 */
	public boolean doesOrderAllow (String ItemId, String userId)
	{
		
		return BusinessImplements.GetInstance().getServerProxy().doesOrderAllowSProxy(ItemId, userId);
	
	}

/**
 * methos that getting the PDF file
 * @param itemId
 * @return
 */
	public String getDescription(String itemId) {
		ArrayList<String> answer = BusinessImplements.GetInstance().getServerProxy().getDescriptionProxy(itemId);
		return answer.get(0);
	}
}
